package com.pokermind.dse.tcp.config;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
 * TCP Test Configuration
 * 专门为TCP模块测试设计的配置类，排除AI相关的自动配置
 * 
 * 排除的配置：
 * - DashScope相关自动配置（避免Netty版本冲突）
 * - AI相关组件（TCP测试不需要）
 * 
 * @author PokerMind Team
 */
@SpringBootApplication(exclude = {
        // 排除所有DashScope自动配置
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeAgentAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeChatAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeEmbeddingAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeImageAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeAudioTranscriptionAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeAudioSpeechAutoConfiguration.class,
        com.alibaba.cloud.ai.autoconfigure.dashscope.DashScopeRerankAutoConfiguration.class
})
@ComponentScan(
    basePackages = {
        "com.pokermind.common",
        "com.pokermind.model", 
        "com.pokermind.repository",
        "com.pokermind.operator",
        "com.pokermind.dse.tcp"
    },
    excludeFilters = {
        // 排除AI相关组件
        @ComponentScan.Filter(type = FilterType.REGEX, 
                pattern = "com\\.pokermind\\.operator\\.ai\\..*"),
        @ComponentScan.Filter(type = FilterType.REGEX,
                pattern = ".*AIAnalysisOperator"),
        // 排除Spring AI相关组件  
        @ComponentScan.Filter(type = FilterType.REGEX,
                pattern = ".*\\.ai\\..*")
    }
)
public class TcpTestConfiguration {

    public static void main(String[] args) {
        SpringApplication.run(TcpTestConfiguration.class, args);
    }
}
